This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jun 26, 2012, 1:46 PM
4 Posts
topic has been resolvedResolved

NotesXSPDocument - Inserting a boolean breaks getDocument

  • Category: Server Side JavaScript
  • Platform: Linux
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 0
I have an XPage which has just broken due to (what should have been) a small change.
 
If I run (where document1 is NotesXSPDocument datasource) :
 
document1.replaceItem("ItemName", false); //or true, or any variable/formula that results in a boolean
 
followed by:
 
document1.getDocument(true); 
 
I end up with an error [TypeError] Exception occurred calling method NotesXspDocument.getDocument(boolean) null
 
It doesn't seem to be an artifact of anything else in the page, as a basic test page confirms it. It doesn't happen with anything (I've found) other than a boolean. This is on a new document (so not saved yet, which I've not tested, but might make a difference), hence I can't just set the field on the underlying doc.
 
Any advice, other than just change the data type?
 
Thanks
 
 
EDIT:  Answered on StackOverflow - it's just the way it is. Switch to a number, however and it's fine (and you can still treat it as a boolean later on and it works)
 
 
------------Test XSP code------------
 <?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"><xp:this.data>
    <xp:dominoDocument var="document1" formName="Test" />
  </xp:this.data><xp:span style="font-weight:bold">
    Button 1 code:</xp:span><xp:br></xp:br>document1.replaceItemValue(&quot;Test&quot;,false);
<xp:br></xp:br>var doc:NotesDocument = document1.getDocument(true);
<xp:br></xp:br>print(doc.toString());<xp:br></xp:br>
    <xp:button value="Test 1" id="button1">
        <xp:eventHandler event="onclick" submit="true"
            refreshMode="complete">
            <xp:this.action><![CDATA[#{javascript:document1.replaceItemValue("Test",false);
var doc:NotesDocument = document1.getDocument(true);
print(doc.toString());}]]></xp:this.action>
        </xp:eventHandler></xp:button>
    <xp:br></xp:br>
    <xp:br></xp:br>
    <xp:br></xp:br>
    <xp:br></xp:br><xp:span style="font-weight:bold">
    Button</xp:span><xp:span style="font-weight:bold"> 2</xp:span><xp:span style="font-weight:bold"> Code:</xp:span><xp:span style="font-weight:bold"></xp:span>&#160;<xp:br></xp:br>document1.replaceItemValue(&quot;Test&quot;,&quot;Test);<xp:br></xp:br>var doc:NotesDocument = document1.getDocument(true);
<xp:br></xp:br>print(doc.toString());<xp:br></xp:br><xp:button value="Test 2" id="button2">
        <xp:eventHandler event="onclick" submit="true"
            refreshMode="complete">
            <xp:this.action><![CDATA[#{javascript:document1.replaceItemValue("Test","Test");
var doc:NotesDocument = document1.getDocument(true);
print(doc.toString());}]]></xp:this.action>
        </xp:eventHandler></xp:button></xp:view>

 
 
 
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal